package copy;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

//使用字符流,单个字符读
public class CopyFileWithCharStream {
    public static void main(String[] args)
    {
        try(FileReader fr = new FileReader("src/main/source.txt");
        FileWriter fw = new FileWriter("src/main/destination3.txt")){
            int ch;
            while((ch=fr.read())!=-1)
            {
                fw.write(ch);
            }
        }catch (IOException e)
        {
            e.printStackTrace();
        }
    }
}
